import { fakeAnswerRelevanceknowledgeData } from '@/services/datastatistics';

export default {
  namespace: 'popoutRelevance', // model的名字 用来在页面中找到要调用的那一个model

  state: {
    list:[],
    suggestList: [],
    qaList: [],
  },

  effects: {
    *fetchg({ payload, callback }, { call, put }) {
      const response = yield call(fakeAnswerRelevanceknowledgeData, payload);
      if (response) {
        if (callback && typeof callback === 'function') {
          callback(response);
        }
        yield put({
          type: 'save',
          payload: response,
        });
      }
    },
  },

  reducers: {
    save(state, { payload }) {
      return {
        ...state, 
        ...payload,
      };
    },
  },
};
